<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  
  <div id="app"></div>
  <script>
    function Person(){

    }
    let fir=new Person() //实例的 __proto__  指向当前实例的原型
    console.log(Person.prototype == fir.__proto__)  
    console.log(Person.__proto__,fir)
    console.log(Person.prototype.constructor==Person)
  </script>
  <script>
    let app=document.getElementById('app')
    let state=new Proxy({
      val:1
    },
    {
      get:function(target, key, value, receiver){
        let res=Reflect.get(target,key,receiver)
        return res 
      },
      set(target, key, value, receiver){
        const res = Reflect.set(target, key, value, receiver) 
        app.innerText=value
        return res
      }
    })
    function debounce(wait=200,cb){
        let timer
        return function(){
          let args=arguments
          if (!timer) {
            cb.apply(this,args)
            timer=true
            setTimeout(() => {
              timer=false
            }, wait);
          }
          // if (timer) {
          //   // 如果这个时候有将要执行的那么就不执行了
          //   clearInterval(timer)
          // }
          // timer=setTimeout(() => {
          //   console.log(this)
          //   cb.apply(this,args)
          // }, wait);
        }
    }
    function debounce2(wait,cb){
      let timer=new Date()
      return function(){
        
      }
    }
    function func(){
      console.log(state)
      state.val+=1
    }
    document.onmousemove=debounce(2000,func)
    class son{
      constructor(xx,ee){
      }
    }
    const uu=new son()

    const dd={
      a(){},
      c(){}
    }
    console.log({...dd})


    let arr1=[1,2,5,6,72,2,21]
    let arr2=[4,7,2,9,3,6,2]
  </script>
</body>
</html>